<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 版权所有（C）2018 viviworld
' 本程序为自由软件，在自由软件联盟发布的GNU通用公共许可协议的约束下，你可以对其进行再发布及修改。协议版本为第三版或（随你）更新的版本。
' 我们希望发布的这款程序有用，但不保证，甚至不保证它有经济价值和适合特定用途。详情参见GNU通用公共许可协议。
' 你理当已收到一份GNU通用公共许可协议的副本，如果没有，请查阅<http://www.gnu.org/licenses/>

' QQ: 548841861 （木鱼）
' Email： 365zph@gmail.com
' 项目地址：https://gitee.com/banrenma/RefineCMS
' 协议地址： https://gitee.com/banrenma/RefineCMS/blob/master/LICENSE
' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

%>
<% If Not DIRECT_VISIT Then Response.Write "No direct script access allowed" : Response.End%>

<!-- #include file="../head.asp" -->

<div class="container-fluid">
<div class="row">
  <div class="col-md-10">
    <ol class="breadcrumb">
      <li><a href="?<%=QP("rf_action")%>=backend&module=dashboard"><%=T("rf_lang_dashboard")%></a></li>
      <li><a href="?<%=QP("rf_action")%>=backend&module=ds.category"><%=T("rf_lang_datasource_category")%></a></li>
      <% If IsObject(category) And category.iID > 0 Then %>
      <li><a href="?<%=QP("rf_action")%>=backend&module=ds.photos&catID=<%=category.iID%>"><%=category.sCatName%></a></li>
      <% End If %>
      <li class="active"><%If media.iID>0 Then%><%=T("rf_lang_edit")%><%Else%><%=T("rf_lang_add")%><%End If%></li>
    </ol>
  </div>
  <div class="col-md-2">
      
  </div>
</div>
</div>
<script type="text/javascript" src="assets/js/pinyin_dict_notone.js"></script>
<script type="text/javascript" src="assets/js/pinyinUtil.js"></script>
<script type="text/javascript">
function DoPinyin() {
  var mn = $('#medianame').val();
  if(mn == "") {
    alert("<%=T("rf_lang_media_medianame")%>: <%=T("rf_lang_media_medianame_validate")%>");
  } else {
    $('#filename').val(pinyinUtil.getPinyin(mn).replace(/[^a-zA-Z_-\s]/g, "").replace(/\s+/g, "-"));
  }
}
</script>
<div class="container-fluid">
  <div class="row">
    <form class="form-horizontal" ENCTYPE="multipart/form-data" action="" method="post">
    <%If Not rfIsEmpty(message) Then%>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <p class="bg-danger"><%=message%></p>
      </div>
    </div>
    <% End If %>
    <% If Not rfIsEmpty(media.sFilepath) Then%>
      <div class="form-group">
          <label for="alt" class="col-md-2 control-label"><%=T("rf_lang_detail")%></label>
          <div class="col-md-4">
            <img src="<%=media.sFilepath%>" <%=rfPhotoAutoScale(300, 300, media.sResolution)%> />
          </div>
      </div>
      <div class="form-group">
          <label for="alt" class="col-md-2 control-label"></label>
          <div class="col-md-4">
          <ul class="list-unstyled">
            <li><%=media.sResolution%> - <%=media.sExt%> - <%=fmtFileSize(media.iFilesize)%></li>
            <li><%=media.sFilepath%></li>
            <li><%=media.sUsername%></li>
            <li><%=T("rf_lang_updated_at")%>: <%=media.dUpdatedAt%></li>
            <li><%=T("rf_lang_created_at")%>: <%=media.dCreatedAt%></li>
          </ul>
          </div>
      </div>
      <% End If %>
    <div class="form-group">
        <label class="col-md-2 control-label"><%=T("rf_lang_category_cattype")%></label>
        <div class="checkbox col-md-offset-2">
          <% If Not IsNull(catgoryOptions) Then %>
          <% Dim i %>
          <% For i=LBound(catgoryOptions, 2) to UBound(catgoryOptions, 2) %>
          <div class="radio">
            <label>
              <input type="radio" name="cat_id" value="<%=catgoryOptions(0, i) %>"<%If catgoryOptions(0, i)=CInt(media.iCatId) Then %> checked<% End If %>>
              <%=catgoryOptions(1, i) %>
            </label>
          </div>
          <% Next %>
          <% End If %>   
        </div>
    </div>

    <div class="form-group">
        <label for="medianame" class="col-md-2 control-label"><%=T("rf_lang_media_medianame")%></label>
        <div class="col-md-4">
        <input type="text" class="form-control" id="medianame" name="medianame" value="<%=media.sMedianame%>" placeholder="<%=T("rf_lang_media_medianame_validate")%>">
        <input type="hidden" name="id_hidden" value="<%=media.iID%>">
        <%=rfCsrfTokenHiddenInput%>
        </div>
    </div>
    <div class="form-group">
        <label for="filename" class="col-md-2 control-label"><%=T("rf_lang_media_filename")%></label>
        <div class="col-md-4">
        <input type="text" class="form-control" id="filename" name="filename" value="<%=media.sFilename%>" placeholder="<%=T("rf_lang_media_filename_validate")%>">
        <u onclick="DoPinyin();"><%=T("rf_lang_media_filename_pinyin")%></u>
        </div>
    </div>
    <div class="form-group">
        <label for="alt" class="col-md-2 control-label"><%=T("rf_lang_media_alt")%></label>
        <div class="col-md-4">
        <input type="text" class="form-control" id="alt" name="alt" value="<%=media.sAlt%>" placeholder="<%=T("rf_lang_media_thumbnail_tips")%>">
        </div>
    </div>
    <div class="form-group">
        <label for="excerpt" class="col-md-2 control-label"><%=T("rf_lang_media_excerpt")%></label>
        <div class="col-md-8">
          <textarea class="form-control" rows="3" name="excerpt" style="overflow-x:hidden"><%=media.sExcerpt%></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="keywords" class="col-md-2 control-label"><%=T("rf_lang_media_keywords")%></label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="keywords" value="<%=media.sKeywords%>" />
        </div>
    </div>
    <div class="form-group">
        <label for="fullscale" class="col-md-2 control-label"><%=T("rf_lang_media_fullscale")%></label>
        <div class="col-md-4">
        <INPUT TYPE="file" NAME="fullscale" id="fullscale" />
        <p class="help-block"><%=Join(RF_UPLOAD_FILETYPE_PHOTO, " | ")%></p>
        </div>
    </div>
   
      
      <div class="form-group">
        <div class="col-md-offset-2 col-sm-10">
          <button type="submit" class="btn btn-primary"><%=T("rf_lang_save")%></button>
        </div>
      </div>
    </form>
  </div>
  </div>

<!-- #include file="../foot.asp" -->